package org.ecloud.auth.server.service;

public interface OAuthService {

	// auth code
    public void addAuthCode(String authCode, String clientId);
    public void removeAuthCode(String authCode);
    public boolean checkAuthCode(String authCode);
    
    // access token
    public void addAccessToken(String accessToken, String clientId);
    public void removeAccessToken(String accessToken);
    public boolean checkAccessToken(String accessToken);
    
    // refresh token
    public void addRefreshToken(String refreshToken, String clientId);
    public void removeRefreshToken(String refreshToken);
    public boolean checkRefreshToken(String refreshToken);

    public String getClientIdByAuthCode(String authCode);
    public String getClientIdByAccessToken(String accessToken);
    public String getClientIdByRefreshToken(String refreshToken);

    // auth code / access token 过期时间
    public long getExpireIn();

    public boolean checkClientId(String clientId);
    public boolean checkClientSecret(String clientSecret);
    public boolean checkClientIdSecret(String clientId, String clientSecret);
    
}
